import express from "express";
import { handleDifyRequest } from "../services/apiAdapter.js";
import { getConversations, deleteConversation, renameConversation, getConversationMessages, getSuggestedQuestions } from "../services/conversationService.js";

const router = express.Router();

// 处理API请求
router.post("/", handleDifyRequest);

// 会话列表路由
router.get("/conversations", getConversations);
// 删除会话路由
router.delete("/conversations/:conversationId", deleteConversation);

// 会话重命名路由
router.post("/conversations/:conversationId/name", renameConversation);

// 获取会话历史消息路由
router.get("/messages", getConversationMessages);

// 获取下一轮建议问题列表路由
router.get("/messages/:messageId/suggested", getSuggestedQuestions);
export default router;
